package com.power.sifa.approve.model;


import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
*  被申请人实体类
*/

@Entity
@ApiModel(value="被申请人")
@Data
@Table(name="Apl_target",schema="sfapprove")
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Builder
//@IdClass(Apl_target.Apl_targetPK.class) 用于复合组件
public class Apl_target extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "applyid+nanoid")
    private String id;

    @ApiModelProperty(value = "申请id")
    private String applyid;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "行政区划代码")
    private String adid;

    @ApiModelProperty(value = "组织机构代码")
    private String admunitid;

    @ApiModelProperty(value = "法定代表人")
    private String manager;

    @ApiModelProperty(value = "委托代理人")
    private String agenter;

    @ApiModelProperty(value = "联系地址")
    private String address;

    @ApiModelProperty(value = "联系电话")
    private String phone;

    @ApiModelProperty(value = "顺序号")
    private Integer sortnum;



    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("applyid", this.getApplyid());
        map.put("name", this.getName());
        map.put("adid", this.getAdid());
        map.put("manager", this.getManager());
        map.put("agenter", this.getAgenter());
        map.put("address", this.getAddress());
        map.put("phone", this.getPhone());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Apl_targetPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Apl_targetPK pk = (Apl_targetPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
